package com.zjitc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/22 14:34
 * @description:
 */
@Controller
public class RController {

  /**
   * hello.do?code=xxx
   * @param code
   * @return
   */
  @RequestMapping(value = "/hello/{code}/{mode}", method = RequestMethod.GET)
  @ResponseBody
  public String hello(@PathVariable(value = "code", required = false) String code,
      @PathVariable(value = "mode") String mode) {
    return "hello world" + code + mode;
  }

  @RequestMapping("/world")
  @ResponseBody
  public String world(String code) {
    return "hello world" + code;
  }
}
